home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AppsToGo / DTS.Lib / Extra Headers / Drag.h next >
Encoding:
C/C++ Source or Header  |  1994-09-22  |  14.7 KB  |  381 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Drag.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __DRAG__
  13. #define __DRAG__
  14.  
  15. #ifndef __APPLEEVENTS__
  16. #include <AppleEvents.h>
  17. /*    #include <Types.h>                                            */
  18. /*        #include <ConditionalMacros.h>                            */
  19. /*        #include <MixedMode.h>                                    */
  20. /*            #include <Traps.h>                                    */
  21. /*    #include <Memory.h>                                            */
  22. /*    #include <OSUtils.h>                                        */
  23. /*    #include <Events.h>                                            */
  24. /*        #include <Quickdraw.h>                                    */
  25. /*            #include <QuickdrawText.h>                            */
  26. /*                #include <IntlResources.h>                        */
  27. /*    #include <EPPC.h>                                            */
  28. /*        #include <PPCToolBox.h>                                    */
  29. /*            #include <AppleTalk.h>                                */
  30. /*        #include <Processes.h>                                    */
  31. /*            #include <Files.h>                                    */
  32. /*                #include <SegLoad.h>                            */
  33. /*    #include <Notification.h>                                    */
  34. #endif
  35.  
  36. #ifndef __TEXTEDIT__
  37. #include <TextEdit.h>
  38. #endif
  39.  
  40. #define gestaltDragMgrAttr 'drag'
  41.  
  42. #define gestaltDragMgrPresent 0
  43.  
  44. #define gestaltDragMgrFloatingWind 1
  45.  
  46. #define gestaltPPCDragLibPresent 2
  47.  
  48. #define gestaltTEAttr 'teat'
  49.  
  50. #define gestaltTEHasGetHiliteRgn 0
  51.  
  52. enum  {
  53.     flavorSenderOnly            = 0x00000001L,
  54.     flavorSenderTranslated        = 0x00000002L,
  55.     flavorNotSaved                = 0x00000004L,
  56.     flavorSystemTranslated        = 0x00000100L
  57. };
  58.  
  59. typedef unsigned long FlavorFlags;
  60.  
  61. enum  {
  62.     dragHasLeftSenderWindow        = 0x00000001L,
  63.     dragInsideSenderApplication    = 0x00000002L,
  64.     dragInsideSenderWindow        = 0x00000004L
  65. };
  66.  
  67. typedef unsigned long DragAttributes;
  68.  
  69. #define flavorTypeHFS 'hfs '
  70.  
  71. #define flavorTypePromiseHFS 'phfs'
  72.  
  73. #define flavorTypeDirectory 'diry'
  74.  
  75. enum  {
  76.     dragTrackingEnterHandler    = 1,
  77.     dragTrackingEnterWindow        = 2,
  78.     dragTrackingInWindow        = 3,
  79.     dragTrackingLeaveWindow        = 4,
  80.     dragTrackingLeaveHandler    = 5
  81. };
  82.  
  83. typedef short DragTrackingMessage;
  84.  
  85. enum  {
  86.     dragRegionBegin                = 1,
  87.     dragRegionDraw                = 2,
  88.     dragRegionHide                = 3,
  89.     dragRegionIdle                = 4,
  90.     dragRegionEnd                = 5
  91. };
  92.  
  93. typedef short DragRegionMessage;
  94.  
  95. enum  {
  96.     zoomNoAcceleration            = 0,
  97.     zoomAccelerate                = 1,
  98.     zoomDecelerate                = 2
  99. };
  100.  
  101. typedef short ZoomAcceleration;
  102.  
  103. typedef unsigned long DragReference;
  104.  
  105. typedef unsigned long ItemReference;
  106.  
  107. typedef ResType FlavorType;
  108.  
  109. enum  {
  110.     badDragRefErr                = -1850,
  111.     badDragItemErr                = -1851,
  112.     badDragFlavorErr            = -1852,
  113.     duplicateFlavorErr            = -1853,
  114.     cantGetFlavorErr            = -1854,
  115.     duplicateHandlerErr            = -1855,
  116.     handlerNotFoundErr            = -1856,
  117.     dragNotAcceptedErr            = -1857
  118. };
  119.  
  120. #if defined(powerc) || defined (__powerc)
  121. #pragma options align=mac68k
  122. #endif
  123. struct HFSFlavor {
  124.     OSType                        fileType;
  125.     OSType                        fileCreator;
  126.     unsigned short                fdFlags;
  127.     FSSpec                        fileSpec;
  128. };
  129. #if defined(powerc) || defined(__powerc)
  130. #pragma options align=reset
  131. #endif
  132.  
  133. typedef struct HFSFlavor HFSFlavor;
  134.  
  135. #if defined(powerc) || defined (__powerc)
  136. #pragma options align=mac68k
  137. #endif
  138. struct PromiseHFSFlavor {
  139.     OSType                        fileType;
  140.     OSType                        fileCreator;
  141.     unsigned short                fdFlags;
  142.     FlavorType                    promisedFlavor;
  143. };
  144. #if defined(powerc) || defined(__powerc)
  145. #pragma options align=reset
  146. #endif
  147.  
  148. typedef struct PromiseHFSFlavor PromiseHFSFlavor;
  149.  
  150. #ifdef __cplusplus
  151. extern "C" {
  152. #endif
  153.  
  154. typedef pascal OSErr (*DragTrackingHandlerProcPtr)(DragTrackingMessage message, WindowPtr theWindow, void *handlerRefCon, DragReference theDragRef);
  155.  
  156. enum {
  157.     uppDragTrackingHandlerProcInfo = kPascalStackBased
  158.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  159.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(DragTrackingMessage)))
  160.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(WindowPtr)))
  161.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void*)))
  162.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(DragReference)))
  163. };
  164.  
  165. #if USESROUTINEDESCRIPTORS
  166. typedef UniversalProcPtr DragTrackingHandlerUPP;
  167.  
  168. #define CallDragTrackingHandlerProc(userRoutine, message, theWindow, handlerRefCon, theDragRef)        \
  169.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDragTrackingHandlerProcInfo, (message), (theWindow), (handlerRefCon), (theDragRef))
  170. #define NewDragTrackingHandlerProc(userRoutine)        \
  171.         (DragTrackingHandlerUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragTrackingHandlerProcInfo, GetCurrentISA())
  172. #else
  173. typedef DragTrackingHandlerProcPtr DragTrackingHandlerUPP;
  174.  
  175. #define CallDragTrackingHandlerProc(userRoutine, message, theWindow, handlerRefCon, theDragRef)        \
  176.         (*(userRoutine))((message), (theWindow), (handlerRefCon), (theDragRef))
  177. #define NewDragTrackingHandlerProc(userRoutine)        \
  178.         (DragTrackingHandlerUPP)(userRoutine)
  179. #endif
  180.  
  181. typedef DragTrackingHandlerUPP DragTrackingHandler;
  182.  
  183. typedef pascal OSErr (*DragReceiveHandlerProcPtr)(WindowPtr theWindow, void *handlerRefCon, DragReference theDragRef);
  184.  
  185. enum {
  186.     uppDragReceiveHandlerProcInfo = kPascalStackBased
  187.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  188.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(WindowPtr)))
  189.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void*)))
  190.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(DragReference)))
  191. };
  192.  
  193. #if USESROUTINEDESCRIPTORS
  194. typedef UniversalProcPtr DragReceiveHandlerUPP;
  195.  
  196. #define CallDragReceiveHandlerProc(userRoutine, theWindow, handlerRefCon, theDragRef)        \
  197.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDragReceiveHandlerProcInfo, (theWindow), (handlerRefCon), (theDragRef))
  198. #define NewDragReceiveHandlerProc(userRoutine)        \
  199.         (DragReceiveHandlerUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragReceiveHandlerProcInfo, GetCurrentISA())
  200. #else
  201. typedef DragReceiveHandlerProcPtr DragReceiveHandlerUPP;
  202.  
  203. #define CallDragReceiveHandlerProc(userRoutine, theWindow, handlerRefCon, theDragRef)        \
  204.         (*(userRoutine))((theWindow), (handlerRefCon), (theDragRef))
  205. #define NewDragReceiveHandlerProc(userRoutine)        \
  206.         (DragReceiveHandlerUPP)(userRoutine)
  207. #endif
  208.  
  209. typedef DragReceiveHandlerUPP DragReceiveHandler;
  210.  
  211. typedef pascal OSErr (*DragSendDataProcPtr)(FlavorType theType, void *dragSendRefCon, ItemReference theItemRef, DragReference theDragRef);
  212.  
  213. enum {
  214.     uppDragSendDataProcInfo = kPascalStackBased
  215.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  216.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(FlavorType)))
  217.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void*)))
  218.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(ItemReference)))
  219.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(DragReference)))
  220. };
  221.  
  222. #if USESROUTINEDESCRIPTORS
  223. typedef UniversalProcPtr DragSendDataUPP;
  224.  
  225. #define CallDragSendDataProc(userRoutine, theType, dragSendRefCon, theItemRef, theDragRef)        \
  226.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDragSendDataProcInfo, (theType), (dragSendRefCon), (theItemRef), (theDragRef))
  227. #define NewDragSendDataProc(userRoutine)        \
  228.         (DragSendDataUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragSendDataProcInfo, GetCurrentISA())
  229. #else
  230. typedef DragSendDataProcPtr DragSendDataUPP;
  231.  
  232. #define CallDragSendDataProc(userRoutine, theType, dragSendRefCon, theItemRef, theDragRef)        \
  233.         (*(userRoutine))((theType), (dragSendRefCon), (theItemRef), (theDragRef))
  234. #define NewDragSendDataProc(userRoutine)        \
  235.         (DragSendDataUPP)(userRoutine)
  236. #endif
  237.  
  238. typedef DragSendDataUPP DragSendDataProc;
  239.  
  240. typedef pascal OSErr (*DragInputProcPtr)(Point *mouse, short *modifiers, void *dragInputRefCon, DragReference theDragRef);
  241.  
  242. enum {
  243.     uppDragInputProcInfo = kPascalStackBased
  244.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  245.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Point*)))
  246.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short*)))
  247.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void*)))
  248.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(DragReference)))
  249. };
  250.  
  251. #if USESROUTINEDESCRIPTORS
  252. typedef UniversalProcPtr DragInputUPP;
  253.  
  254. #define CallDragInputProc(userRoutine, mouse, modifiers, dragInputRefCon, theDragRef)        \
  255.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDragInputProcInfo, (mouse), (modifiers), (dragInputRefCon), (theDragRef))
  256. #define NewDragInputProc(userRoutine)        \
  257.         (DragInputUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragInputProcInfo, GetCurrentISA())
  258. #else
  259. typedef DragInputProcPtr DragInputUPP;
  260.  
  261. #define CallDragInputProc(userRoutine, mouse, modifiers, dragInputRefCon, theDragRef)        \
  262.         (*(userRoutine))((mouse), (modifiers), (dragInputRefCon), (theDragRef))
  263. #define NewDragInputProc(userRoutine)        \
  264.         (DragInputUPP)(userRoutine)
  265. #endif
  266.  
  267. typedef DragInputUPP DragInputProc;
  268.  
  269. typedef pascal OSErr (*DragDrawingProcPtr)(DragRegionMessage message, RgnHandle showRegion, Point showOrigin, RgnHandle hideRegion, Point hideOrigin, void *dragDrawingRefCon, DragReference theDragRef);
  270.  
  271. enum {
  272.     uppDragDrawingProcInfo = kPascalStackBased
  273.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  274.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(DragRegionMessage)))
  275.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(RgnHandle)))
  276.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Point)))
  277.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(RgnHandle)))
  278.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(Point)))
  279.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(void*)))
  280.          | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(DragReference)))
  281. };
  282.  
  283. #if USESROUTINEDESCRIPTORS
  284. typedef UniversalProcPtr DragDrawingUPP;
  285.  
  286. #define CallDragDrawingProc(userRoutine, message, showRegion, showOrigin, hideRegion, hideOrigin, dragDrawingRefCon, theDragRef)        \
  287.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDragDrawingProcInfo, (message), (showRegion), (showOrigin), (hideRegion), (hideOrigin), (dragDrawingRefCon), (theDragRef))
  288. #define NewDragDrawingProc(userRoutine)        \
  289.         (DragDrawingUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragDrawingProcInfo, GetCurrentISA())
  290. #else
  291. typedef DragDrawingProcPtr DragDrawingUPP;
  292.  
  293. #define CallDragDrawingProc(userRoutine, message, showRegion, showOrigin, hideRegion, hideOrigin, dragDrawingRefCon, theDragRef)        \
  294.         (*(userRoutine))((message), (showRegion), (showOrigin), (hideRegion), (hideOrigin), (dragDrawingRefCon), (theDragRef))
  295. #define NewDragDrawingProc(userRoutine)        \
  296.         (DragDrawingUPP)(userRoutine)
  297. #endif
  298.  
  299. typedef DragDrawingUPP DragDrawingProc;
  300.  
  301. extern pascal OSErr InstallTrackingHandler(DragTrackingHandler trackingHandler, WindowPtr theWindow, void *handlerRefCon)
  302.  TWOWORDINLINE(0x7001, 0xABED);
  303. extern pascal OSErr InstallReceiveHandler(DragReceiveHandler receiveHandler, WindowPtr theWindow, void *handlerRefCon)
  304.  TWOWORDINLINE(0x7002, 0xABED);
  305. extern pascal OSErr RemoveTrackingHandler(DragTrackingHandler trackingHandler, WindowPtr theWindow)
  306.  TWOWORDINLINE(0x7003, 0xABED);
  307. extern pascal OSErr RemoveReceiveHandler(DragReceiveHandler receiveHandler, WindowPtr theWindow)
  308.  TWOWORDINLINE(0x7004, 0xABED);
  309. extern pascal OSErr NewDrag(DragReference *theDragRef)
  310.  TWOWORDINLINE(0x7005, 0xABED);
  311. extern pascal OSErr DisposeDrag(DragReference theDragRef)
  312.  TWOWORDINLINE(0x7006, 0xABED);
  313. extern pascal OSErr AddDragItemFlavor(DragReference theDragRef, ItemReference theItemRef, FlavorType theType, void *dataPtr, Size dataSize, FlavorFlags theFlags)
  314.  TWOWORDINLINE(0x7007, 0xABED);
  315. extern pascal OSErr SetDragItemFlavorData(DragReference theDragRef, ItemReference theItemRef, FlavorType theType, const void *dataPtr, Size dataSize, unsigned long dataOffset)
  316.  TWOWORDINLINE(0x7009, 0xABED);
  317. extern pascal OSErr SetDragSendProc(DragReference theDragRef, DragSendDataProc sendProc, void *dragSendRefCon)
  318.  TWOWORDINLINE(0x700A, 0xABED);
  319. extern pascal OSErr SetDragInputProc(DragReference theDragRef, DragInputProc inputProc, void *dragInputRefCon)
  320.  TWOWORDINLINE(0x700B, 0xABED);
  321. extern pascal OSErr SetDragDrawingProc(DragReference theDragRef, DragDrawingProc drawingProc, void *dragDrawingRefCon)
  322.  TWOWORDINLINE(0x700C, 0xABED);
  323. extern pascal OSErr TrackDrag(DragReference theDragRef, const EventRecord *theEvent, RgnHandle theRegion)
  324.  TWOWORDINLINE(0x700D, 0xABED);
  325. extern pascal OSErr CountDragItems(DragReference theDragRef, unsigned short *numItems)
  326.  TWOWORDINLINE(0x700E, 0xABED);
  327. extern pascal OSErr GetDragItemReferenceNumber(DragReference theDragRef, unsigned short index, ItemReference *theItemRef)
  328.  TWOWORDINLINE(0x700F, 0xABED);
  329. extern pascal OSErr CountDragItemFlavors(DragReference theDragRef, ItemReference theItemRef, unsigned short *numFlavors)
  330.  TWOWORDINLINE(0x7010, 0xABED);
  331. extern pascal OSErr GetFlavorType(DragReference theDragRef, ItemReference theItemRef, unsigned short index, FlavorType *theType)
  332.  TWOWORDINLINE(0x7011, 0xABED);
  333. extern pascal OSErr GetFlavorFlags(DragReference theDragRef, ItemReference theItemRef, FlavorType theType, FlavorFlags *theFlags)
  334.  TWOWORDINLINE(0x7012, 0xABED);
  335. extern pascal OSErr GetFlavorDataSize(DragReference theDragRef, ItemReference theItemRef, FlavorType theType, Size *dataSize)
  336.  TWOWORDINLINE(0x7013, 0xABED);
  337. extern pascal OSErr GetFlavorData(DragReference theDragRef, ItemReference theItemRef, FlavorType theType, void *dataPtr, Size *dataSize, unsigned long dataOffset)
  338.  TWOWORDINLINE(0x7014, 0xABED);
  339. extern pascal OSErr GetDragItemBounds(DragReference theDragRef, ItemReference theItemRef, Rect *itemBounds)
  340.  TWOWORDINLINE(0x7015, 0xABED);
  341. extern pascal OSErr SetDragItemBounds(DragReference theDragRef, ItemReference theItemRef, const Rect *itemBounds)
  342.  TWOWORDINLINE(0x7016, 0xABED);
  343. extern pascal OSErr GetDropLocation(DragReference theDragRef, AEDesc *dropLocation)
  344.  TWOWORDINLINE(0x7017, 0xABED);
  345. extern pascal OSErr SetDropLocation(DragReference theDragRef, const AEDesc *dropLocation)
  346.  TWOWORDINLINE(0x7018, 0xABED);
  347. extern pascal OSErr GetDragAttributes(DragReference theDragRef, DragAttributes *flags)
  348.  TWOWORDINLINE(0x7019, 0xABED);
  349. extern pascal OSErr GetDragMouse(DragReference theDragRef, Point *mouse, Point *pinnedMouse)
  350.  TWOWORDINLINE(0x701A, 0xABED);
  351. extern pascal OSErr SetDragMouse(DragReference theDragRef, Point pinnedMouse)
  352.  TWOWORDINLINE(0x701B, 0xABED);
  353. extern pascal OSErr GetDragOrigin(DragReference theDragRef, Point *initialMouse)
  354.  TWOWORDINLINE(0x701C, 0xABED);
  355. extern pascal OSErr GetDragModifiers(DragReference theDragRef, short *modifiers, short *mouseDownModifiers, short *mouseUpModifiers)
  356.  TWOWORDINLINE(0x701D, 0xABED);
  357. extern pascal OSErr ShowDragHilite(DragReference theDragRef, RgnHandle hiliteFrame, Boolean inside)
  358.  TWOWORDINLINE(0x701E, 0xABED);
  359. extern pascal OSErr HideDragHilite(DragReference theDragRef)
  360.  TWOWORDINLINE(0x701F, 0xABED);
  361. extern pascal OSErr DragPreScroll(DragReference theDragRef, short dH, short dV)
  362.  TWOWORDINLINE(0x7020, 0xABED);
  363. extern pascal OSErr DragPostScroll(DragReference theDragRef)
  364.  TWOWORDINLINE(0x7021, 0xABED);
  365. extern pascal OSErr UpdateDragHilite(DragReference theDragRef, RgnHandle updateRgn)
  366.  TWOWORDINLINE(0x7022, 0xABED);
  367. extern pascal Boolean WaitMouseMoved(Point initialMouse)
  368.  TWOWORDINLINE(0x7023, 0xABED);
  369. extern pascal OSErr ZoomRects(const Rect *fromRect, const Rect *toRect, short zoomSteps, ZoomAcceleration acceleration)
  370.  TWOWORDINLINE(0x7024, 0xABED);
  371. extern pascal OSErr ZoomRegion(RgnHandle region, Point zoomDistance, short zoomSteps, ZoomAcceleration acceleration)
  372.  TWOWORDINLINE(0x7025, 0xABED);
  373. extern pascal OSErr TEGetHiliteRgn(RgnHandle region, TEHandle hTE)
  374.  THREEWORDINLINE(0x3F3C, 0x000F, 0xA83D);
  375. #ifdef __cplusplus
  376. }
  377. #endif
  378.  
  379. #endif
  380.  
  381.